🎖️GitЯра🎖️
Node / meshtastic / Meshtastic-Android / files / feature / node / src / commonMain / kotlin / org / meshtastic / feature / node / component / DeviceActions.kt
Displaying Raw • Download
feature/node/src/commonMain/kotlin/org/meshtastic/feature/node/component/DeviceActions.kt 520fa717a938fd84682403b41f57d9f7e1ef49ef (520fa717) Text, 7.67 KB
T8b949e/*
* Copyright (c) 2025-2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
Tff7b72package T7ee787org.meshtastic.feature.node.component
Tff7b72import T7ee787androidx.compose.foundation.layout.Arrangement
Tff7b72import T7ee787androidx.compose.foundation.layout.Column
Tff7b72import T7ee787androidx.compose.foundation.layout.Row
Tff7b72import T7ee787androidx.compose.foundation.layout.Spacer
Tff7b72import T7ee787androidx.compose.foundation.layout.fillMaxWidth
Tff7b72import T7ee787androidx.compose.foundation.layout.padding
Tff7b72import T7ee787androidx.compose.foundation.layout.width
Tff7b72import T7ee787androidx.compose.material3.Button
Tff7b72import T7ee787androidx.compose.material3.ButtonDefaults
Tff7b72import T7ee787androidx.compose.material3.Icon
Tff7b72import T7ee787androidx.compose.material3.IconToggleButton
Tff7b72import T7ee787androidx.compose.material3.LocalContentColor
Tff7b72import T7ee787androidx.compose.material3.MaterialTheme
Tff7b72import T7ee787androidx.compose.material3.OutlinedButton
Tff7b72import T7ee787androidx.compose.material3.Text
Tff7b72import T7ee787androidx.compose.runtime.Composable
Tff7b72import T7ee787androidx.compose.ui.Alignment
Tff7b72import T7ee787androidx.compose.ui.Modifier
Tff7b72import T7ee787androidx.compose.ui.graphics.Color
Tff7b72import T7ee787androidx.compose.ui.unit.dp
Tff7b72import T7ee787org.jetbrains.compose.resources.stringResource
Tff7b72import T7ee787org.meshtastic.core.model.Node
Tff7b72import T7ee787org.meshtastic.core.resources.Res
Tff7b72import T7ee787org.meshtastic.core.resources.actions
Tff7b72import T7ee787org.meshtastic.core.resources.direct_message
Tff7b72import T7ee787org.meshtastic.core.resources.favorite
Tff7b72import T7ee787org.meshtastic.core.resources.ignore
Tff7b72import T7ee787org.meshtastic.core.resources.mute_notifications
Tff7b72import T7ee787org.meshtastic.core.resources.remove
Tff7b72import T7ee787org.meshtastic.core.resources.share_contact
Tff7b72import T7ee787org.meshtastic.core.ui.component.ListItem
Tff7b72import T7ee787org.meshtastic.core.ui.component.SwitchListItem
Tff7b72import T7ee787org.meshtastic.core.ui.icon.Delete
Tff7b72import T7ee787org.meshtastic.core.ui.icon.Favorite
Tff7b72import T7ee787org.meshtastic.core.ui.icon.MeshtasticIcons
Tff7b72import T7ee787org.meshtastic.core.ui.icon.Message
Tff7b72import T7ee787org.meshtastic.core.ui.icon.NotFavorite
Tff7b72import T7ee787org.meshtastic.core.ui.icon.QrCode2
Tff7b72import T7ee787org.meshtastic.core.ui.icon.VolumeMute
Tff7b72import T7ee787org.meshtastic.core.ui.icon.VolumeOff
Tff7b72import T7ee787org.meshtastic.core.ui.icon.VolumeUp
Tff7b72import T7ee787org.meshtastic.feature.node.model.LogsType
Tff7b72import T7ee787org.meshtastic.feature.node.model.NodeDetailAction
Tff7b72import T7ee787org.meshtastic.feature.node.model.isEffectivelyUnmessageable
Tff7b72import T7ee787org.meshtastic.proto.Config
Tf0883e@Composable
Tff7b72fun Td2a8ffDeviceActionsTb4b4b4(
Te6edf3nodeTb4b4b4: Te6edf3NodeTb4b4b4,
Te6edf3ourNodeTb4b4b4: Te6edf3Node?Tb4b4b4,
Te6edf3lastTracerouteTimeTb4b4b4: Tffa657Long?Tb4b4b4,
Te6edf3lastRequestNeighborsTimeTb4b4b4: Tffa657Long?Tb4b4b4,
Te6edf3availableLogsTb4b4b4: Te6edf3SetTff7b72<Te6edf3LogsTypeTff7b72>Tb4b4b4,
Te6edf3onActionTb4b4b4: Tb4b4b4(Te6edf3NodeDetailActionTb4b4b4) Tff7b72-Tff7b72> Tffa657UnitTb4b4b4,
Te6edf3displayUnitsTb4b4b4: Te6edf3ConfigTb4b4b4.Te6edf3DisplayConfigTb4b4b4.Te6edf3DisplayUnitsTb4b4b4,
Te6edf3isFahrenheitTb4b4b4: Tffa657BooleanTb4b4b4,
Te6edf3modifierTb4b4b4: Te6edf3Modifier Tff7b72= Te6edf3ModifierTb4b4b4,
Te6edf3isLocalTb4b4b4: Tffa657Boolean Tff7b72= Tff7b72falseTb4b4b4,
Tb4b4b4) Tb4b4b4{
Te6edf3ColumnTb4b4b4(Te6edf3modifier Tff7b72= Te6edf3modifierTb4b4b4.Te6edf3fillMaxWidthTb4b4b4(Tb4b4b4)Tb4b4b4, Te6edf3verticalArrangement Tff7b72= Te6edf3ArrangementTb4b4b4.Te6edf3spacedByTb4b4b4(T79c0ff1T79c0ff6.Te6edf3dpTb4b4b4)Tb4b4b4) Tb4b4b4{
Te6edf3SectionCardTb4b4b4(Te6edf3title Tff7b72= Te6edf3ResTb4b4b4.Te6edf3stringTb4b4b4.Te6edf3actionsTb4b4b4) Tb4b4b4{
Te6edf3PrimaryActionsRowTb4b4b4(Te6edf3node Tff7b72= Te6edf3nodeTb4b4b4, Te6edf3isLocal Tff7b72= Te6edf3isLocalTb4b4b4, Te6edf3onAction Tff7b72= Te6edf3onActionTb4b4b4)
Tff7b72if Tb4b4b4(Tff7b72!Te6edf3isLocalTb4b4b4) Tb4b4b4{
Te6edf3SectionDividerTb4b4b4(Te6edf3ModifierTb4b4b4.Te6edf3paddingTb4b4b4(Te6edf3vertical Tff7b72= T79c0ff8.Te6edf3dpTb4b4b4)Tb4b4b4)
Te6edf3ManagementActionsTb4b4b4(Te6edf3node Tff7b72= Te6edf3nodeTb4b4b4, Te6edf3onAction Tff7b72= Te6edf3onActionTb4b4b4)
Tb4b4b4}
Tb4b4b4}
Te6edf3TelemetricActionsSectionTb4b4b4(
Te6edf3node Tff7b72= Te6edf3nodeTb4b4b4,
Te6edf3ourNode Tff7b72= Te6edf3ourNodeTb4b4b4,
Te6edf3availableLogs Tff7b72= Te6edf3availableLogsTb4b4b4,
Te6edf3lastTracerouteTime Tff7b72= Te6edf3lastTracerouteTimeTb4b4b4,
Te6edf3lastRequestNeighborsTime Tff7b72= Te6edf3lastRequestNeighborsTimeTb4b4b4,
Te6edf3displayUnits Tff7b72= Te6edf3displayUnitsTb4b4b4,
Te6edf3isFahrenheit Tff7b72= Te6edf3isFahrenheitTb4b4b4,
Te6edf3onAction Tff7b72= Te6edf3onActionTb4b4b4,
Te6edf3isLocal Tff7b72= Te6edf3isLocalTb4b4b4,
Tb4b4b4)
Tb4b4b4}
Tb4b4b4}
Tf0883e@Composable
Tff7b72private Tff7b72fun Td2a8ffPrimaryActionsRowTb4b4b4(Te6edf3nodeTb4b4b4: Te6edf3NodeTb4b4b4, Te6edf3isLocalTb4b4b4: Tffa657BooleanTb4b4b4, Te6edf3onActionTb4b4b4: Tb4b4b4(Te6edf3NodeDetailActionTb4b4b4) Tff7b72-Tff7b72> Tffa657UnitTb4b4b4) Tb4b4b4{
Te6edf3RowTb4b4b4(
Te6edf3modifier Tff7b72= Te6edf3ModifierTb4b4b4.Te6edf3paddingTb4b4b4(Te6edf3horizontal Tff7b72= T79c0ff2T79c0ff0.Te6edf3dpTb4b4b4)Tb4b4b4.Te6edf3fillMaxWidthTb4b4b4(Tb4b4b4)Tb4b4b4,
Te6edf3horizontalArrangement Tff7b72= Te6edf3ArrangementTb4b4b4.Te6edf3spacedByTb4b4b4(T79c0ff1T79c0ff2.Te6edf3dpTb4b4b4)Tb4b4b4,
Te6edf3verticalAlignment Tff7b72= Te6edf3AlignmentTb4b4b4.Te6edf3CenterVerticallyTb4b4b4,
Tb4b4b4) Tb4b4b4{
Tff7b72if Tb4b4b4(Tff7b72!Te6edf3nodeTb4b4b4.Te6edf3isEffectivelyUnmessageable Tff7b72&Tff7b72& Tff7b72!Te6edf3isLocalTb4b4b4) Tb4b4b4{
Te6edf3ButtonTb4b4b4(
Te6edf3onClick Tff7b72= Tb4b4b4{ Te6edf3onActionTb4b4b4(Te6edf3NodeDetailActionTb4b4b4.Te6edf3HandleNodeMenuActionTb4b4b4(Te6edf3NodeMenuActionTb4b4b4.Te6edf3DirectMessageTb4b4b4(Te6edf3nodeTb4b4b4)Tb4b4b4)Tb4b4b4) Tb4b4b4}Tb4b4b4,
Te6edf3modifier Tff7b72= Te6edf3ModifierTb4b4b4.Te6edf3weightTb4b4b4(T79c0ff1fTb4b4b4)Tb4b4b4,
Te6edf3shape Tff7b72= Te6edf3MaterialThemeTb4b4b4.Te6edf3shapesTb4b4b4.Te6edf3largeTb4b4b4,
Te6edf3colors Tff7b72=
Te6edf3ButtonDefaultsTb4b4b4.Te6edf3buttonColorsTb4b4b4(
Te6edf3containerColor Tff7b72= Te6edf3MaterialThemeTb4b4b4.Te6edf3colorSchemeTb4b4b4.Te6edf3primaryContainerTb4b4b4,
Te6edf3contentColor Tff7b72= Te6edf3MaterialThemeTb4b4b4.Te6edf3colorSchemeTb4b4b4.Te6edf3onPrimaryContainerTb4b4b4,
Tb4b4b4)Tb4b4b4,
Tb4b4b4) Tb4b4b4{
Te6edf3IconTb4b4b4(Te6edf3MeshtasticIconsTb4b4b4.Te6edf3MessageTb4b4b4, Te6edf3contentDescription Tff7b72= Tff7b72nullTb4b4b4)
Te6edf3SpacerTb4b4b4(Te6edf3ModifierTb4b4b4.Te6edf3widthTb4b4b4(T79c0ff8.Te6edf3dpTb4b4b4)Tb4b4b4)
Te6edf3TextTb4b4b4(Te6edf3stringResourceTb4b4b4(Te6edf3ResTb4b4b4.Te6edf3stringTb4b4b4.Te6edf3direct_messageTb4b4b4)Tb4b4b4)
Tb4b4b4}
Tb4b4b4}
Te6edf3OutlinedButtonTb4b4b4(
Te6edf3onClick Tff7b72= Tb4b4b4{ Te6edf3onActionTb4b4b4(Te6edf3NodeDetailActionTb4b4b4.Te6edf3ShareContactTb4b4b4) Tb4b4b4}Tb4b4b4,
Te6edf3modifier Tff7b72= Tff7b72if Tb4b4b4(Te6edf3nodeTb4b4b4.Te6edf3isEffectivelyUnmessageable Tff7b72|Tff7b72| Te6edf3isLocalTb4b4b4) Te6edf3ModifierTb4b4b4.Te6edf3weightTb4b4b4(T79c0ff1fTb4b4b4) Tff7b72else Te6edf3ModifierTb4b4b4,
Te6edf3shape Tff7b72= Te6edf3MaterialThemeTb4b4b4.Te6edf3shapesTb4b4b4.Te6edf3largeTb4b4b4,
Tb4b4b4) Tb4b4b4{
Te6edf3IconTb4b4b4(Te6edf3MeshtasticIconsTb4b4b4.Te6edf3QrCode2Tb4b4b4, Te6edf3contentDescription Tff7b72= Tff7b72nullTb4b4b4)
Tff7b72if Tb4b4b4(Te6edf3nodeTb4b4b4.Te6edf3isEffectivelyUnmessageable Tff7b72|Tff7b72| Te6edf3isLocalTb4b4b4) Tb4b4b4{
Te6edf3SpacerTb4b4b4(Te6edf3ModifierTb4b4b4.Te6edf3widthTb4b4b4(T79c0ff8.Te6edf3dpTb4b4b4)Tb4b4b4)
Te6edf3TextTb4b4b4(Te6edf3stringResourceTb4b4b4(Te6edf3ResTb4b4b4.Te6edf3stringTb4b4b4.Te6edf3share_contactTb4b4b4)Tb4b4b4)
Tb4b4b4}
Tb4b4b4}
Tff7b72if Tb4b4b4(Tff7b72!Te6edf3isLocalTb4b4b4) Tb4b4b4{
Te6edf3IconToggleButtonTb4b4b4(
Te6edf3checked Tff7b72= Te6edf3nodeTb4b4b4.Te6edf3isFavoriteTb4b4b4,
Te6edf3onCheckedChange Tff7b72= Tb4b4b4{ Te6edf3onActionTb4b4b4(Te6edf3NodeDetailActionTb4b4b4.Te6edf3HandleNodeMenuActionTb4b4b4(Te6edf3NodeMenuActionTb4b4b4.Te6edf3FavoriteTb4b4b4(Te6edf3nodeTb4b4b4)Tb4b4b4)Tb4b4b4) Tb4b4b4}Tb4b4b4,
Tb4b4b4) Tb4b4b4{
Te6edf3IconTb4b4b4(
Te6edf3imageVector Tff7b72= Tff7b72if Tb4b4b4(Te6edf3nodeTb4b4b4.Te6edf3isFavoriteTb4b4b4) Te6edf3MeshtasticIconsTb4b4b4.Te6edf3Favorite Tff7b72else Te6edf3MeshtasticIconsTb4b4b4.Te6edf3NotFavoriteTb4b4b4,
Te6edf3contentDescription Tff7b72= Te6edf3stringResourceTb4b4b4(Te6edf3ResTb4b4b4.Te6edf3stringTb4b4b4.Te6edf3favoriteTb4b4b4)Tb4b4b4,
Te6edf3tint Tff7b72= Tff7b72if Tb4b4b4(Te6edf3nodeTb4b4b4.Te6edf3isFavoriteTb4b4b4) Te6edf3ColorTb4b4b4.Te6edf3Yellow Tff7b72else Te6edf3LocalContentColorTb4b4b4.Te6edf3currentTb4b4b4,
Tb4b4b4)
Tb4b4b4}
Tb4b4b4}
Tb4b4b4}
Tb4b4b4}
Tf0883e@Composable
Tff7b72private Tff7b72fun Td2a8ffManagementActionsTb4b4b4(Te6edf3nodeTb4b4b4: Te6edf3NodeTb4b4b4, Te6edf3onActionTb4b4b4: Tb4b4b4(Te6edf3NodeDetailActionTb4b4b4) Tff7b72-Tff7b72> Tffa657UnitTb4b4b4) Tb4b4b4{
Te6edf3Column Tb4b4b4{
Te6edf3SwitchListItemTb4b4b4(
Te6edf3text Tff7b72= Te6edf3stringResourceTb4b4b4(Te6edf3ResTb4b4b4.Te6edf3stringTb4b4b4.Te6edf3ignoreTb4b4b4)Tb4b4b4,
Te6edf3leadingIcon Tff7b72=
Tff7b72if Tb4b4b4(Te6edf3nodeTb4b4b4.Te6edf3isIgnoredTb4b4b4) Tb4b4b4{
Te6edf3MeshtasticIconsTb4b4b4.Te6edf3VolumeMute
Tb4b4b4} Tff7b72else Tb4b4b4{
Te6edf3MeshtasticIconsTb4b4b4.Te6edf3VolumeUp
Tb4b4b4}Tb4b4b4,
Te6edf3checked Tff7b72= Te6edf3nodeTb4b4b4.Te6edf3isIgnoredTb4b4b4,
Te6edf3onClick Tff7b72= Tb4b4b4{ Te6edf3onActionTb4b4b4(Te6edf3NodeDetailActionTb4b4b4.Te6edf3HandleNodeMenuActionTb4b4b4(Te6edf3NodeMenuActionTb4b4b4.Te6edf3IgnoreTb4b4b4(Te6edf3nodeTb4b4b4)Tb4b4b4)Tb4b4b4) Tb4b4b4}Tb4b4b4,
Tb4b4b4)
Tff7b72if Tb4b4b4(Te6edf3nodeTb4b4b4.Te6edf3capabilitiesTb4b4b4.Te6edf3canMuteNodeTb4b4b4) Tb4b4b4{
Te6edf3SwitchListItemTb4b4b4(
Te6edf3text Tff7b72= Te6edf3stringResourceTb4b4b4(Te6edf3ResTb4b4b4.Te6edf3stringTb4b4b4.Te6edf3mute_notificationsTb4b4b4)Tb4b4b4,
Te6edf3leadingIcon Tff7b72=
Tff7b72if Tb4b4b4(Te6edf3nodeTb4b4b4.Te6edf3isMutedTb4b4b4) Tb4b4b4{
Te6edf3MeshtasticIconsTb4b4b4.Te6edf3VolumeOff
Tb4b4b4} Tff7b72else Tb4b4b4{
Te6edf3MeshtasticIconsTb4b4b4.Te6edf3VolumeUp
Tb4b4b4}Tb4b4b4,
Te6edf3checked Tff7b72= Te6edf3nodeTb4b4b4.Te6edf3isMutedTb4b4b4,
Te6edf3onClick Tff7b72= Tb4b4b4{ Te6edf3onActionTb4b4b4(Te6edf3NodeDetailActionTb4b4b4.Te6edf3HandleNodeMenuActionTb4b4b4(Te6edf3NodeMenuActionTb4b4b4.Te6edf3MuteTb4b4b4(Te6edf3nodeTb4b4b4)Tb4b4b4)Tb4b4b4) Tb4b4b4}Tb4b4b4,
Tb4b4b4)
Tb4b4b4}
Te6edf3ListItemTb4b4b4(
Te6edf3text Tff7b72= Te6edf3stringResourceTb4b4b4(Te6edf3ResTb4b4b4.Te6edf3stringTb4b4b4.Te6edf3removeTb4b4b4)Tb4b4b4,
Te6edf3leadingIcon Tff7b72= Te6edf3MeshtasticIconsTb4b4b4.Te6edf3DeleteTb4b4b4,
Te6edf3trailingIcon Tff7b72= Tff7b72nullTb4b4b4,
Te6edf3textColor Tff7b72= Te6edf3MaterialThemeTb4b4b4.Te6edf3colorSchemeTb4b4b4.Te6edf3errorTb4b4b4,
Te6edf3leadingIconTint Tff7b72= Te6edf3MaterialThemeTb4b4b4.Te6edf3colorSchemeTb4b4b4.Te6edf3errorTb4b4b4,
Te6edf3onClick Tff7b72= Tb4b4b4{ Te6edf3onActionTb4b4b4(Te6edf3NodeDetailActionTb4b4b4.Te6edf3HandleNodeMenuActionTb4b4b4(Te6edf3NodeMenuActionTb4b4b4.Te6edf3RemoveTb4b4b4(Te6edf3nodeTb4b4b4)Tb4b4b4)Tb4b4b4) Tb4b4b4}Tb4b4b4,
Tb4b4b4)
Tb4b4b4}
Tb4b4b4}
Served by rngit 1.5.0 - Generated in 0.06s